package com.qunar.itts.validator;

import java.util.Set;

import javax.validation.ConstraintViolation;
import javax.validation.Validator;
import javax.validation.metadata.BeanDescriptor;

import com.qunar.itts.validator.bean.ValidateResult;
import com.qunar.itts.validator.service.BeanValidateService;

/**
 *  TODO 
 * @author wangxinchun1988@163.com
 * @date 2015-5-11 上午10:49:10
 */
public class QnuarValidator implements Validator {

	@Override
	public <T> Set<ConstraintViolation<T>> validate(T object,
			Class<?>... groups) {
		ValidateResult result = BeanValidateService.getInstance().validate(object);
		System.out.println(result.getMessage());
		return null;
	}

	@Override
	public <T> Set<ConstraintViolation<T>> validateProperty(T object,
			String propertyName, Class<?>... groups) {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public <T> Set<ConstraintViolation<T>> validateValue(Class<T> beanType,
			String propertyName, Object value, Class<?>... groups) {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public BeanDescriptor getConstraintsForClass(Class<?> clazz) {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public <T> T unwrap(Class<T> type) {
		// TODO Auto-generated method stub
		return null;
	}

}
